<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8" xmlns:th="http://www.thymeleaf.org">
    <title>Title</title>
</head>
<body>
<div>
    <h1>普通方式</h1>
    <span th:text="${userName}"></span>
    <h2>inline</h2>
    <span>[[${userName}]]</span>


    <script>
        var userId = [[${userId}]];
        var userName = "[[${userName}]]";
        console.log("用户编号:"+userId);
        alert("欢迎光临"+userName);


    </script>
</div>
</body>

</html>